package org.rpc.common;

import java.io.Serializable;

/**
 * @author tzf
 * @description: 公共的调用对象
 * @date: 2023/11/16 18:23
 */

public class Invocation implements Serializable {
    // 接口名
    private String interfaceName;
    // 方法名
    private String methodName;
    //方法参数类型列表
    private Class<?>[] parameterTypes;
    //参数列表
    private Object[] parameters;
    //版本号
    private String version = "1.0";

    public Invocation(String interfaceName, String methodName, Class<?>[] parameterTypes, Object[] parameters) {
        this.interfaceName = interfaceName;
        this.methodName = methodName;
        this.parameterTypes = parameterTypes;
        this.parameters = parameters;
    }

    public Invocation(String interfaceName, String methodName, Class<?>[] parameterTypes, Object[] parameters, String version) {
        this.interfaceName = interfaceName;
        this.methodName = methodName;
        this.parameterTypes = parameterTypes;
        this.parameters = parameters;
        this.version = version;
    }

    public Invocation() {
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getInterfaceName() {
        return interfaceName;
    }

    public void setInterfaceName(String interfaceName) {
        this.interfaceName = interfaceName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public Class<?>[] getParameterTypes() {
        return parameterTypes;
    }

    public void setParameterTypes(Class<?>[] parameterTypes) {
        this.parameterTypes = parameterTypes;
    }

    public Object[] getParameters() {
        return parameters;
    }

    public void setParameters(Object[] parameters) {
        this.parameters = parameters;
    }
}
